{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class=""><a href="{:url('admin/api/index')}">API管理</a></li>
            <li class="layui-this">添加API</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form form-container" action="{:url('admin/api/save')}" method="post">
                    <div class="layui-form-item">
                        <label class="layui-form-label">API版本</label>
                        <div class="layui-input-block">
                            <select name="version" required lay-verify="required">
                                {foreach name="api_version_list" item="vo"}
                                <option value="{$vo.id}">{$vo.name}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">API URL</label>
                        <div class="layui-input-block">
                            <input type="text" name="api_url" value="" required  lay-verify="required" placeholder="请输入API URL" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">API描述</label>
                        <div class="layui-input-block">
                            <input type="text" name="api_description" value="" placeholder="（选填）请输入API描述" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">是否禁用</label>
                        <div class="layui-input-block">
                            <select name="is_status" required lay-verify="required">
                                <option value="1">启用</option>
                                <option value="2">禁用</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">是否公用</label>
                        <div class="layui-input-block">
                            <select name="is_public" required lay-verify="required">
                                <option value="1">私有</option>
                                <option value="2">公用</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="*">保存</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}